from init.celery import celery
import time


# celery使用方式1
@celery.task
def add(x, y):
    time.sleep(5)
    return x + y


@celery.task
def mul(x, y):
    time.sleep(5)
    return x * y


@celery.task
def send_mail(msg):
    print(f"Sending mail: {msg}")
    return "Mail sent"
